<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="icon" href="img/logo.ico" type="image/x-icon"/>
    <link rel="shortcut icon" href="img/logo.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="css/index.css"/>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

    <title>A市人民医院欢迎您</title>
</head>
<body>
<div class="main">
    <div class="top">
        <div class="top_logo">
        </div>
        <div class="top_menu">
            <a href="#" class="button" id="首页">首页</a>
            <a href="detail.html" class="button" id="医院概况">医院概况</a>
            <a href="news.html" class="button" id="新闻中心">新闻中心</a>
            <a href="department.html" class="button" id="科室介绍">科室介绍</a>
            <a href="doc.html" class="button" id="医生风采">医生风采</a>
            <a href="health.html" class="button" id="健康知识">健康知识</a>
            <div class="top_tool">
                <div class="医院概况"></div>
                <div class="新闻中心"></div>
                <div class="科室介绍"></div>
                <div class="医生风采"></div>
                <div class="健康知识"></div>
            </div>
        </div>

        <div class="top_login" style="width: 200px">
            <div class="header"></div>
            <div class="top_login_word" id="loginAndReg">
                <a href="login.html">登录</a>&nbsp;&nbsp;丨&nbsp;
                <a href="register.html">注册</a>
            </div>
            <div class="top_login_word" id="userLogin" style="width: 120px">
                <b>欢迎<a id="changeUser" href="user.html"> <span id="userName"></span></a></b>
            </div>
        </div>

    </div>
    <div class="mid">
        <div class="top_menu_hid" id="概况">
            <a href="detail.html">医院介绍</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="detail.html">领导团队</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="detail.html">医院历史</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="detail.html">医院荣誉</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="detail.html">组织架构</a>
        </div>
        <div class="top_menu_hid" id="新闻">
            <a href="news.html">新闻动态</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">媒体视角</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">视频新闻</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">专题报道</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">新闻聚集</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">世界新闻</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="news.html">电子院刊</a>
        </div>
        <div class="top_menu_hid" id="科室">
            <a href="department.html">科室介绍</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="department.html">科室查询</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="department.html">科室信息</a>
        </div>
        <div class="top_menu_hid" id="医生">
            <a href="doc.html">优秀医生</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="doc.html">专家团队</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="doc.html">白衣天使</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="doc.html">诊疗特色</a>
        </div>
        <div class="top_menu_hid" id="健康">
            <a href="health.html">健康视频</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="health.html">健康传播</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="health.html">生活贴士</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="health.html">专家讲座</a>
        </div>
        <div class="mid_pic">
            <!-- 轮播图 -->
            <div id="demo" class="carousel slide" data-ride="carousel">

                <!-- 指示符 -->
                <ul class="carousel-indicators">
                    <li data-target="#demo" data-slide-to="0" class="active"></li>
                    <li data-target="#demo" data-slide-to="1"></li>
                    <li data-target="#demo" data-slide-to="2"></li>
                    <li data-target="#demo" data-slide-to="3"></li>
                </ul>

                <!-- 轮播图片 -->
                <div class="carousel-inner">
                    <div class="carousel-item active">
                        <img src="img/pic1.jpg">
                    </div>
                    <div class="carousel-item">
                        <img src="img/pic2.jpg">
                    </div>
                    <div class="carousel-item">
                        <img src="img/pic3.jpg">
                    </div>
                    <div class="carousel-item">
                        <img src="img/pic4.jpg">
                    </div>
                </div>

                <!-- 左右切换按钮 -->
                <a class="carousel-control-prev" href="#demo" data-slide="prev">
                    <span class="carousel-control-prev-icon"></span>
                </a>
                <a class="carousel-control-next" href="#demo" data-slide="next">
                    <span class="carousel-control-next-icon"></span>
                </a>
            </div>
        </div>
        <div class="mid_menu">
            <div id="在线咨询"><a href=""><img src="img/在线咨询1.jpg" onMouseOver="this.src='img/在线咨询2.jpg'"
                                           onMouseOut="this.src='img/在线咨询1.jpg'"></a></div>
            <div id="挂号预约"><a href=""><img src="img/挂号预约1.jpg" onMouseOver="this.src='img/挂号预约2.jpg'"
                                           onMouseOut="this.src='img/挂号预约1.jpg'"></a></div>
        </div>
    </div>
    <div class="black"></div>
    <div class="bot">
        <div class="bot_news">
            <div class="bot_news_title">
                <div class="bot_news_title1"><a>新闻资讯</a></div>
                <div class="bot_news_title2"><a href="news.html"><img src="img/more.png" width="65px" height="21px"></a>
                </div>
            </div>
            <div class="bot_news_pic">
                <div id="mydemo" class="carousel slide" data-ride="carousel">
                    <div class="carousel-inner">
                        <div class="carousel-item active">
                            <img src="img/pic01.jpg">
                        </div>
                        <div class="carousel-item">
                            <img src="img/pic02.jpg">
                        </div>
                        <div class="carousel-item">
                            <img src="img/pic03.jpg">
                        </div>
                        <div class="carousel-item">
                            <img src="img/pic04.jpg">
                        </div>
                    </div>

                </div>
            </div>
            <div class="bot_news_word">
                <div class="word">
                    <br/>
                    <a href="">A市人民医院呼吁全社会无偿献血倡议书</a><br/><br/>
                    <a href="">我院针对癌症治疗研究的全新突破</a><br/><br/>
                    <a href="">A市人民医院献礼第109个国际护士节</a><br/><br/>
                    <a href="">迎五四青年节 手机摄影大赛圆满落幕</a><br/><br/>
                    <a href="">众志成城·抗击疫情</a><br/><br/>
                    <a href="">领导看望疫情期间坚守岗位的医护人员</a><br/><br/>
                    <a href="">疫情捐赠物资名单</a>
                </div>

            </div>
        </div>
        <div class="black"></div>
        <div class="bot_notice">
            <div class="bot_notice_title">
                <div class="bot_notice_title1"><a>热点公告</a></div>
            </div>
            <div class="bot_notice_word">
                <div class="word">
                    <br/>
                    <a href="">A市人民医院就诊攻略</a><br/><br/>
                    <a href="">A市人民医院关于劳动节假期的值班安排</a><br/><br/>
                    <a href="">多个诊室医生招聘公告</a><br/><br/>
                    <a href="">庆祝我院一周院庆</a><br/><br/>
                    <a href="">关于我院病房紧急扩建的通知</a><br/><br/>
                    <a href="">众志成城·抗击疫情</a><br/><br/>
                    <a href="">热烈庆祝A市人民医院网站正式上线</a>
                </div>

            </div>
        </div>
        <div class="bot_tips">
            <div class="bot_tips_title">
                <div class="bot_tips_title1"><a>健康传播</a></div>
            </div>
            <div class="bot_tips_word">
                <div class="word">
                    <br/>
                    <a href="">全国《职业病防治法》宣传周:中暑了怎么办？</a><br/><br/>
                    <a href="">全国《职业病防治法》宣传周: 误把“毒液”当饮品导致的灾害</a><br/><br/>
                    <a href="">疫情期间要注意哪些问题·这些细节不可忽视</a><br/><br/>
                    <a href="">别再劝人“趁热吃”了，小心劝出食管癌！</a><br/><br/>
                    <a href="">健康饮食·从绿色食品开始</a><br/><br/>
                    <a href="">做好体重管理，专家教你怎么吃！——来自营养科专家的饮食秘笈</a><br/><br/>
                    <a href="">医保政策问答·一图读懂医保药品</a>
                </div>

            </div>
        </div>
    </div>
    <div class="black"></div>
    <div class="other">
        <div class="link_word">友情链接</div>
        <div class="link">
            <a href="http://www.lcu.edu.cn/"><img src="img/lcu_logo.png" height="50px" width="50px"/></a>
        </div>
        <div class="other_word">
            声明：本网站仅为学术研究，不为商用。所用大部分文案、图案均来源于网络，如有侵权请联系站主更换。
        </div>
    </div>
</div>
<script type="text/javascript" src="js/index.js"></script>
</body>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<script type="application/javascript">

    var loginAndReg = $("#loginAndReg");
    var userInfo = null;

    $(document).ready(function () {
        var userLogin = $("#userLogin");
        userLogin.hide();
        ifLogin();
    });

    function ifLogin() {
        $.ajax({
            async: true,
            type: "post",
            url: "/ifLogin",
            contentType: 'application/json',
            dataType: "text",
            success: function (data) {
                var result = JSON.parse(data);
                userInfo = result.RESULT;
                if (result.SUCCESS) {
                    console.log("用户已登录！");
                    console.log(userInfo);
                    afterLogin();
                } else {
                    console.log(result);
                    console.log(result.RESULT);
                }
            },
            error: function (data) {
                alert("请求失败");
            }
        });


    }

    function afterLogin() {
        var loginAndReg = $("#loginAndReg");
        var userLogin = $("#userLogin");
        var userName = $("#userName");
        var sex = "先生";
        loginAndReg.hide();
        userLogin.show();
        if(userInfo.sex == 1){
            sex = "女士";
        }else{
            sex = "先生";
        }

        if(userInfo.identity == 1){
            $("#changeUser").attr("href","user.html");
        }else if(userInfo.identity == 2){
            $("#changeUser").attr("href","doctor.html") ;
        }else{
            $("#changeUser").attr("href","admin.html") ;
        }
        if(typeof(userInfo.name) == "undefined"){
            userName.text("管理员");
        }else{
            userName.text(userInfo.name+sex);
        }
    }


</script>

</html>
